home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / comm / fido / wpl_intro.lzh / wpl / roof.wpl < prev   
Text File  |  1992-12-17  |  43KB  |  1,283 lines

  1.  ; $VER: ROOF WPL    Welmat WPL Language File for Roof     Williamson 49.62
  2.  ; =============================================================================
  3.  ;
  4.  ; This version expects the Log and Status windows to display the LINE, so
  5.  ; if you wish the LINE to appear in the LOG, do a search/replace for 
  6.  ; '$<time>' with '$<time> $(line)'
  7.  ;
  8.  ; We use the Nodelist Lookup program defined by the ENV: variable LOOKUP
  9.  ; Either Russell McOrmond's Igen 'LOOKUP' and David Lebel's TrapList 
  10.  ; 'TLlookup' may be used.
  11.  ; 
  12.  ; Roof Function Hosts (RoofCMD, FLOWMGR, RoofLog ) are used to: 
  13.  ; -   read FTS1 packet in an attempt to get the callers address 
  14.  ; -   move and format Wnotify output to Roof's logfile
  15.  ; -   Log inbound address in Roof's logfile
  16.  ; -   display in separate windows the name, size and address of files
  17.  ;     received and sent
  18.  ; -   flowadd text files for XPRascii (commented awaiting sn XPR3 XPRascii)
  19.  ; -   start import and tick processes
  20.  ;
  21.  ; A number of ENV variable's are set from Roof.CFG, via CRON events 
  22.  ; and/or external programs.
  23.  ;
  24.  ; Some of these include:
  25.  ;  ${SYSTEM}                       - the name of the system
  26.  ;  ${SYSOP}                        - the sysop's name
  27.  ;  ${HOST.ADDRESS.$(domain)}       - the host address for each domain.
  28.  ;  ${ALLOWFREQS}                   - if file requests are accepted
  29.  ;  ${FTSFREQS}                     - if file requests are accepted in 
  30.  ;                                    FTS1 sessions
  31.  ;  ${ACCESS}                       - if BBS and RFX access is permitted
  32.  ;  ${MNAME.$(remote.product)}      - the remote mailers name,
  33.  ;  ${W_SLAVE_LOGFILE}              - fullpathname, slave logfile
  34.  ;  ${W_SLAVE_STATUS}               - Status Window
  35.  ;  ${ROOFSCREEN}                   - PubLic Screen
  36.  ;  ${W_LNG}                        - full pathname, wpl file
  37.  ;  ${ROOFNAME}                     - Roof's Public Screen Title
  38.  ;  ${RVER}                         - Roof Major version
  39.  ;  ${RTAB}                         - Roof minor version
  40.  ;  ${RCFGVER}                      - ROOF.CFG version
  41.  ;  ${INDIR}                        - base of inbound directory tree
  42.  ;  ${OUTDIR}                       - outbound directory
  43.  ;
  44.  ; ENV: variables also set Roof and Welmat logfile names, windows and 
  45.  ; publicscreens, rexx script path, and other variables.
  46.  ; ENV: variables set from ROOF.CFG or Roof modules are in UPPERCASE.
  47.  ;
  48.  ; Features:
  49.  ; - sets title of XPR status window to indicate sessiontype (INBOUND 
  50.  ;   or OUTBOUND), protocol and address of site
  51.  ; - optionally not accept FREQS in FTS1 sessions
  52.  ; - dobanner routine to send and print
  53.  ; - sayit routine to Speak with externally defined loglevel
  54.  ; - RFX User Uploads/Downloads using RFX.welmat with Wnotify 
  55.  ;   and the freq.lst created by FileMGR.rexx. Disabled during UMH.
  56.  ; - TIC logging, message and bbs area update processing is deferred 
  57.  ;   until after session
  58.  ; - Wnotify FREQ logging to RoofLog
  59.  ; - sets inbound dir based upon remote.wzdomain or remote.zone
  60.  ; - if enabled, uses a directory for non-secure mail transfers
  61.  ;   this directory is ALWAYS used for RFX uploads
  62.  ; - Will not send a FileRequest if remote WaZoo indicates freqs not accepted
  63.  ; - Will not process an incoming File Request when Dialing Out
  64.  ; - FREQS can be disabled during UMH using the ENV: variable ALLOWFREQS
  65.  ; - Direct Launch of BBS via ESC-ESC
  66.  ; - will answer if call comes in during a dial
  67.  ; - fast system command execution
  68.  ; - informative STATE settings
  69.  ; - hooks for security checks
  70.  ;
  71.  ; =============================================================================
  72.  
  73.  ; Just in case a null Jump is SubJump'd ;-)
  74.   Print "You Goofed up your config, eh!\n"
  75.   Return
  76.  
  77.  ; External calls go though this Jump table to speed up label search
  78.   preinbound:
  79.     Jump pri
  80.   preoutbound:
  81.     Jump pro
  82.   postinbound:
  83.     Jump poi
  84.   postoutbound:
  85.     Jump poo
  86.  
  87.  ; ==============================Fancy Stuff ===================================
  88.  
  89.   ; Set the titlebar and open the XPR status display  
  90.   set_xprstatus:
  91.     Set titadr "$(protocol) $(session) $(remote.domain) $(remote.zone) $(remote.net) $(remote.node) $(remote.point) ${$(line).sysop} ${$(line).sitename}"
  92.     SetUpDate "CON:0/60/640/$($(line).w_offset)/$(titadr)/AUTO/SCREEN$(pscreen)"
  93.     Clear titadr
  94.   return
  95.  
  96.  ; Say and Print something
  97.   sayit:
  98.     Print "$(speech)\n"
  99.     System "Rx \"return (GetClip('SAYLEVEL') >= $(sl))\""
  100.     TrueReturn
  101.         System "run >nil: SAY \"$(speech)\""
  102.         Clear speech
  103.         Return
  104.  
  105.   ; Print, Send and Clear the variable 'banner'
  106.   dobanner:
  107.     Print $(banner)
  108.     Send $(banner)
  109.     Clear banner
  110.   Return
  111.  
  112.   ; execute an external command  
  113.   ; you may want to use setpri before and after to 'hopefully' speed
  114.   ; programs that we must wait on.
  115.   dosys:
  116.     ; save current state
  117.     Set tstate $(state)
  118.     Set state "EXTERNAL"
  119.     System $(systemcmd)
  120.     ; restore previous state
  121.     Set state $(tstate)
  122.     Clear systemcmd tstate
  123.   Return
  124.  
  125.   ; set wpl nodelist variables remote.#? to the env:$(line).#? values that
  126.   ; were set by nodelist lookup program
  127.   setnode:
  128.     Set remote.number   ${$(line).number}
  129.     Set remote.password ${$(line).password}
  130.     Set remote.zone     ${$(line).zone}
  131.     Set remote.net      ${$(line).net}
  132.     Set remote.node     ${$(line).node}
  133.     Set remote.point    ${$(line).point}
  134.     ; we may NOT want to do this one in a multi-domain setup
  135.     ; as it may not be the real domain
  136.     Set remote.domain   ${$(line).domain}
  137.   Return
  138.  
  139.   ck_multiftn:
  140.     Pattern $(remote.address) #?$(mixed_up_hub)#?
  141.     FalseReturn
  142.         ; Set your host address to the one to which HE sends all mail
  143.         SubJump fidohost
  144.         Set inbound $(nonsecure)
  145.         Set multihub TRUE
  146.         Set RC 0
  147.   Return
  148.  
  149.  ; ============================ WAZOO PROCESSING =========================
  150.  ; called on both inbound and outbound after receiving a yoohoo
  151.  
  152.   wazoo:
  153.  ;  if you do not have my version of Yves' WAZOO util, then uncomment 
  154.  ;  the following three lines.
  155.  ;  PutLog "$<time> WaZoo:[$(remote.sitename)][$(remote.address)][$(remote.wzdomain)]"
  156.  ;  PutLog "$<time> Freq:$(remote.freq) Cap:$(remote.wzcap) Set:$(host.wzcap)"
  157.  ;  PutLog "$<time> Sysop:$(remote.sysop) Mailer:${mname.$(remote.product)} v$(remote.product_maj).$(remote.product_min)"
  158.  
  159.  ; This requires my residentable version 1.1 or better of Yves' WaZOO program,
  160.  ; if not available, comment the following lines upto the chekwzcap label
  161.     PutLog "$<time> System:[$(remote.sitename)][$(remote.address)]"
  162.     PutLog "$<time> Sysop:$(remote.sysop) Mailer:${mname.$(remote.product)} v$(remote.product_maj).$(remote.product_min)"
  163.     System "Wazoo $(remote.wzcap) $(line).RYH"
  164.  
  165.     ; Our default when dialing
  166.     Set temp "-Freq +Domain $(host.wzdomain)"
  167.     Set RC $(IsOutbound)
  168.     TrueJump notin
  169.         CmpI $(host.freq) FALSE
  170.         TrueJump is.1
  171.             Set temp "+Freq +Domain $(host.wzdomain)"
  172.   is.1:
  173.     PutLog "$<time> Our Offer: DietIFNA ZedZip ZedZap $(temp)"
  174.   notin:
  175.     PutLog "$<time> Remote Offer:${$(line).RYH} $(remote.wzdomain)"
  176.  
  177.   checkwzcap:
  178.     ; we set the 'protocol' variable for later use in Print and PutLog
  179.     ; No assumptions are made, we CHECK for DietIFNA
  180.     Cmp $(host.wzcap) 1
  181.     FalseJump wazoo.1.0
  182.         Set protocol DietIFNA
  183.         PutLog "$<time> Selected: $(protocol)"
  184.         Jump wazoo.4
  185.   wazoo.1.0:
  186.     Cmp $(host.wzcap) 4
  187.     FalseJump wazoo.1.1
  188.         Set protocol ZedZip
  189.         PutLog "$<time> Selected: $(protocol)"
  190.         Jump wazoo.4
  191.   wazoo.1.1:
  192.     Cmp $(host.wzcap) 8
  193.     FalseJump wazoo.1.2
  194.         Set protocol ZedZap
  195.         PutLog "$<time> Selected: $(protocol)"
  196.         Jump wazoo.4
  197.   wazoo.1.2:
  198.     ; any additional WaZoo protocols would be added here
  199.     PutLog "$<time> Selected: Testing $(host.wzcap)"
  200.  
  201.   wazoo.4:
  202.     Clear temp
  203.     Set RC $(IsOutbound)
  204.     TrueJump goodwazoo
  205.         ; Here we do any special setup based upon the wazoo parameters 
  206.         ; of an Incoming call 
  207.  
  208.         ; Check if this is a hub which bundles all your mail
  209.         ; for multiple FTNs in a single archive
  210.       ;  SubJump ck_multiftn
  211.       ;  TrueJump wazoo_lookup
  212.  
  213.         ; Check if inbound address is known in our PKM.cfg    
  214.         ; this requires FLowHOST.rexx and PKM.cfg
  215.         ; TODO, have flowhost keep a separate list of KNOWN address
  216.         ; so that we can include address for which we DO NOT pack mail
  217.         Set issecure TRUE
  218.         Address "FLOWMGR" "ISKNOWN '$(remote.address)' $(line)"
  219.         PutLog "$<time> Address $(remote.address) ${$(line).ISKNOWN}"
  220.         CmpI ${$(line).ISKNOWN} KNOWN
  221.         TrueJump ck_host
  222.             Set inbound $(nonsecure)
  223.             Set issecure FALSE
  224.             Jump wazoo_lookup
  225.   ck_host:
  226.         ; Never check for FIDONET, as Welmat sets this as the default domain
  227.         ; when remote.wzdomain is empty. Here we search for domains anywhere 
  228.         ; in the remote.wzdomain variable and zone in remote.address
  229.         Pattern $(remote.wzdomain) #?mtlnet#?
  230.         TrueSubJump mtlhost
  231.         Pattern $(remote.wzdomain) #?amiganet#?
  232.         TrueSubJump anethost
  233.         ; Check for other domains by Zone, as Zone may be preceeded by an 
  234.         ; incorrect domain name.
  235.         Pattern $(remote.address) #?17:#?
  236.         TrueSubJump mtlhost
  237.         Pattern $(remote.address) #?(39|40|41):#?
  238.         TrueSubJump anethost
  239.  
  240.  wazoo_lookup:
  241.         Set systemcmd "$(lookup) $(remote.address) nodelist: $(line) "
  242.         SubJump dosys
  243.         Cmp $(RC) 0
  244.         TrueJump wazoo.4.1
  245.             PutLog "$<time> $(remote.address) not in NodeList - Lookup:$(RC)"
  246.             ;If we want to accept listed nodes only, then we would do this here:
  247.             ;Jump badwazoo
  248.   wazoo.4.1:
  249.     ; node was found!
  250.     CmpI ${$(line).password} ""
  251.     TrueJump wazoo4
  252.         ; there IS a password
  253.         CmpI ${$(line).password} $(remote.password)
  254.         TrueJump wazoo3
  255.             PutLog "$<time> Password Error: His:'$(remote.password)' Ours:'${$(line).password}'"
  256.             Jump badwazoo
  257.  
  258.   wazoo3:
  259.     PutLog "$<time> Password Protected Session"
  260.   goodwazoo:
  261.     PutLog "$<time> Host:$(host.address)"
  262.     Set RC TRUE
  263.     return
  264.  
  265.   wazoo4:
  266.     PutLog "$<time> No Password Set"
  267.     ; If we wish to check for proper setup by our points, comment out 
  268.     ; this Jump, and un-comment the following lines
  269.     Jump goodwazoo
  270.     ;Pattern $(remote.address) "$(host.domain)?$(host.zone):$(host.net)/$(host.node).#?"
  271.     ;FalseJump goodwazoo
  272.     ;    PutLog "$<time> Improperly set up point!"
  273.   badwazoo:
  274.         PutLog "$<time> Host:$(host.address)"
  275.         Set RC FALSE
  276.         Return
  277.  
  278.  
  279.  ; =============================== DIAL =====================================
  280.  dodial:
  281.     Set state "DIALING $(remote.address)"
  282.  ; Clear the inbound buffer to Clear any negotiation 'line noise'.
  283.     ModemClear
  284.     
  285.    ; Setup our host.address based upon Zone of address we are calling 
  286.  
  287.     Pattern $(remote.address)  "#?(39|40|41):#?"
  288.     TrueSubJump anethost
  289.     Pattern $(remote.address)  "#?17:#?"
  290.     TrueSubJump mtlhost
  291.  
  292.   ; fun stuff
  293.     Set sl 70 speech "Calling $(remote.address)"
  294.     PutLog "$<time> $(speech)"
  295.     ; call sayit after any PutLog, because Sayit CLEARS 
  296.     ; the 'speech' variable
  297.     SubJump sayit
  298.  
  299.   ; Special setups for unlisted addresses go here, BEFORE nodelist Lookup
  300.   ; for example, phone number for unlisted nodes based upon address, name etc
  301.   ; Mailer flags and wzcap may also be set
  302.         Set remote.number 278-2831
  303.         Pattern $(remote.address) #?40:500/101.0#?
  304.   ; Got a match, Do not do Nodelist Lookup      
  305.         TrueJump dodial2.0
  306.  
  307.   dodial0:
  308.     Set systemcmd "$(lookup) $(remote.address) nodelist: $(line) "
  309.     SubJump dosys   
  310.     Print "Lookup:$(RC) $(remote.address) ${$(line).password}\n"
  311.     FalseJump dodial2
  312.         PutLog "$<time> I don't know the number for $(remote.address)"
  313.         ReportSesStat 6
  314.         Jump waitring
  315.  
  316.   dodial2:
  317.     SubJump setnode
  318.     ; multi-number substitutions for listed addresses go here
  319.     ; In this case, mail mail hub has two other phonelines
  320.     ; and sometimes switches to a modem which wil not conect with mine. 
  321.     Pattern $(remote.address) #?1:167/236#?
  322.     FalseJump dodial2.0
  323.     ;    Set remote.number 847-7545
  324.         Set remote.number 847-7548
  325.  
  326.   dodial2.0:
  327.     SmartSend "~AT&K0&M0DT$(remote.number)|"
  328.     ; Look for a modem response, with a timeout of 30 seconds
  329.     GetResponse 60
  330.     CmpI $(event) CONNECT
  331.     TrueJump callconnect
  332.  
  333.     CmpI $(event) "busy"
  334.     TrueJump dodial2.2
  335.  
  336.     CmpI $(event) "ring"
  337.     TrueJump answerondial 
  338.  
  339.     ;   CmpI $(event) "maid"
  340.     ;   TrueJump dodial2.2
  341.     ;   CmpI $(event) "line"
  342.     ;   TrueJump dodial2.1
  343.  
  344.     ; MOpen was not done before this command, it exited immediately
  345.     CmpI $(event) NOMODEM
  346.     TrueJump slaveloop
  347.     ; Someone else wants the device
  348.     CmpI $(event) OWNDEVUNIT
  349.     TrueJump owndevfreeline
  350.     ; A timeout occured
  351.     CmpI $(event) TIMEOUT
  352.     TrueJump waitring
  353.     ; Carrier 'dropped' during command
  354.     CmpI $(event) CARRIER
  355.     TrueJump waitring
  356.  
  357.   dodial2.1:
  358.     Set temp $(RC)
  359.     Jump dodial3
  360.  
  361.   dodial2.2:
  362.     Set temp 5
  363.   dodial3:
  364.     PutLog "$<time> Temp:$(temp) RC:$(RC) Event:[$(event)] Modem:[$(lastresponse)]"
  365.     ReportSesStat $(temp)
  366.     Jump waitring
  367.  
  368.  ; In order to answer the phone while we are dialing out,
  369.  ; we MUST report back to the original dial caller
  370.   answerondial:
  371.     PutLog "$<time> Got Ring during dial"
  372.     ReportSesStat 5
  373.     Jump answer
  374.  
  375.   callconnect:
  376.     Set session OUTBOUND
  377.     Set state "SESSION OUTBOUND $(remote.address)"
  378.     PutLog "$<time> CallConnect:$(remote.address) $(lastresponse)[$(Baud)]"
  379.  
  380.     ; Send files destined to this site, regardless of YooHoo
  381.     Set called $(remote.address)
  382.     ; Send file queued for address called
  383.     Connected $(called)
  384.     ; Send files queued for address given in WaZoo
  385.     Connected $(remote.address)
  386.  
  387.     ; ========================== GETOUTBOUND ============================= 
  388.     ;
  389.     ; Set WAZOO to indicate file requests are not 
  390.     ; accepted when we are calling out!
  391.     Set host.freq FALSE
  392.     GetOutbound
  393.     PutLog "$<time> OutboundEvent:[$(event)] Wzcap:[$(host.wzcap)]:[$(remote.wzcap)]"
  394.     ; other events: 
  395.     ;   CARRIER     carrier dropped
  396.     ;   NOCLEAR     modem input buffer did not clear
  397.     ;   NOHELLO     remote did not respond to Whack/Return
  398.     ; remote did not respond to Whack/Return
  399.     CmpI $(event) NOANSWER
  400.     TrueJump waitring
  401.  
  402.     CmpI $(event) WAZOO
  403.     FalseJump getfts1
  404.         CmpI $(called) $(remote.address)
  405.         TrueJump getwazoo
  406.             PutLog "$<time> Called:$(called) Got:$(remote.address)"
  407.             ; any special AKA handling ? do it here
  408.   getwazoo:
  409.     ; defined that we are in an Outbound session, so that we
  410.     ; do not do another nodelist lookup in wazoo routine
  411.     Set IsOutbound TRUE
  412.         SubJump wazoo
  413.     Set IsOutbound FALSE
  414.  
  415.     ; Check if remote is accepting File Requests
  416.     Set RC $(remote.freq)
  417.     TrueJump dofreqs
  418.         PutLog "$<time> Freqs disabled at $(called)"
  419.         Jump getwzcap
  420.  
  421.   dofreqs:
  422.   ; Add our file request to queue  
  423.     FindFreq $(called)
  424.   getwzcap:
  425.     Cmp $(host.wzcap) 8
  426.     TrueJump zedzapout
  427.  
  428.     Cmp $(host.wzcap) 4
  429.     TrueJump zedzipout
  430.  
  431.     Cmp $(host.wzcap) 1
  432.     FalseJump nodietout
  433.         PutLog "$<time> DietIFNA fallback"
  434.         Jump dietifnaout
  435.   nodietout:
  436.     PutLog "$<time> "FTS1 fallback"
  437.     Set protocol FTS1
  438.     Jump lotekout
  439.  
  440.   getfts1:
  441.     CmpI $(event) FTS1
  442.     FalseJump noprotocol
  443.         Set protocol FTS1
  444.         Jump lotekout
  445.  
  446.   noprotocol:
  447.         PutLog "$<time> $(remote.address) not Fido-compliant!"
  448.         ReportSesStat 99
  449.         Jump waitring
  450.  
  451.  
  452.  ; ============================= FREE LINE ==================================
  453.  
  454.   ;unwelcome:
  455.   ;  Set banner "\n  Sorry, only 2400bps connections are accepted\n  Bye!\n"
  456.   ;  SubJump dobanner
  457.   ;  Jump freeline
  458.  
  459.   owndevfreeline:
  460.     Set state "EXTERNAL"
  461.     PutLog "$<time> Line in use by external"
  462.  
  463.   freeline:
  464.     Print "Trying to Free Line\n"
  465.     ; close the modem to allow for another device to grab the line
  466.     ModemClose
  467.     System "Wait 3"
  468.  
  469.  ; entered from Slave Startup
  470.   slaveloop:
  471.     SubJump setglobals
  472.     ModemOpen
  473.     Print "ModemOpen:$(RC) "
  474.     TrueJump waitring
  475.         ; what about if it fails?  Maybe just exit the slave with a RETURN?
  476.         PutLog "$<time> Dead modems!!!"
  477.         FlushLog
  478.   Return
  479.  
  480.  ; ======================== Wait for a Call ===============================
  481.  
  482.  
  483.   waitring:
  484.     ; If we received TIC files during last sessio, we now start any 
  485.     ; extra processing, such as sending newfile message, logging to 
  486.     ; RoofLog and updating BBS file lists
  487.     Set RC $(tic)
  488.     FalseJump waitring0.0
  489.         Set systemcmd "Run >NIL: Rx \"Address 'RoofCMD' TICK FILE $(host.domain)\""
  490.         Set tic FALSE
  491.         SubJump dosys
  492.  
  493.   waitring0.0:
  494.     ; default to our fidonet address and inbound dir
  495.     SubJump fidohost
  496.     Set multihub FALSE issecure TRUE
  497.  
  498.     ; If we processed and File request during last session,
  499.     ; we now move Wnotify log to RoofLog
  500.     Set RC $(req)
  501.     FalseJump waitring0.1
  502.         Address "RoofLog" "ADDLOG FREQ"
  503.         Set req FALSE
  504.  
  505.   waitring0.1:   
  506.     CmpI $(state) "WAITING"
  507.     TrueJump waitowndev
  508.         PutLog "$<time> Waiting for a Ring"
  509.         FlushLog
  510.     
  511.   waitring0:
  512.     ; this commented section is suggested by Russ in order to
  513.     ; allow external REXX calls a safe window to call ModemOpen
  514.     ;Set state "BUSY WAITEVENT"
  515.     ;WaitEvent 5
  516.     ;Print "WaitEvent:$(event)\n"
  517.  
  518.     Set state "BUSY MODEM"
  519.     ModemInit
  520.     Print "ModemInit:$(RC) "
  521.     FalseJump freeline
  522.         ; Check the call queue for a call request - Will set the appropriate 
  523.         ; variables if a call was present, and return 'TRUE' in RC
  524.         CheckCall
  525.         Print "CheckCall:$(RC) "
  526.         TrueJump dodial
  527.             ; Variable <abort> figures out the count of 'abort' requests.
  528.             Print "Abort:$<abort>\n"
  529.             Set RC $<abort>
  530.             FalseJump waitring1
  531.                 PutLog "$<time> Exiting Slave$(line)"
  532.                 ModemClose
  533.             CmpI $(exit) RESTART
  534.             FalseReturn
  535.                 Set RC 300
  536.   Return
  537.  
  538.  
  539.   waitring1:
  540.     SubJump setglobals
  541.     ; Set the slave state to 'Waiting'.
  542.     Set state "WAITING"
  543.  
  544.   waitowndev:
  545.     Set OwnDevUnit TRUE
  546.     ; $(CallInterupt) sets whether a rexx CALL command will 
  547.     ; interrupt the GetResponse
  548.     Set CallInterupt TRUE
  549.  
  550.     GetResponse 45
  551.     Set OwnDevUnit FALSE
  552.     Set CallInterupt FALSE
  553.     CmpI $(event) OWNDEVUNIT
  554.     TrueJump owndevfreeline
  555.         CmpI $(event) "ring"
  556.         FalseJump waitring0
  557.  
  558.   answer:
  559.     ; This is the entry point if a call comes in while we are dialing
  560.     ; clear env setup for remote
  561.     System "run >NIL: Delete ENV:$(line).#?"
  562.     Set state "ANSWERING"
  563.     Print "Answer:$(lastresponse)\n"
  564.     PutLog "$<time> Answer:$(lastresponse)"
  565.         ; allow remote to set MNP level
  566.         ;SmartSend "AT&K1&M4A|"
  567.     ; disallow MNP
  568.     SmartSend "AT&K0&M0A|"
  569.     FlushLog
  570.  
  571.     GetResponse 60
  572.     Print "Answer:$(RC) Event:$(event) Modem:$(lastresponse)\n"
  573.     Putlog "$<time> Answer:$(RC) Event:$(event) Modem:$(lastresponse)"
  574.     ; From Response ### or response find
  575.     CmpI $(event) CONNECT
  576.     TrueJump waitring3
  577.     ; No modem reponse received before timeout
  578.     CmpI $(event) TIMEOUT
  579.     TrueJump waitring0
  580.     ; Carrier 'dropped' during command
  581.     CmpI $(event) CARRIER
  582.     TrueJump waitring0
  583.  
  584.   waitring3:
  585.     PutLog "$<time> $(lastResponse) ($(Baud))"
  586.  
  587.     ; Delay for 4 seconds - Delay requires an 'open modem' at the moment
  588.     Delay 6
  589.     ModemClear
  590.  
  591.     ; Check if remote dropped carrier
  592.     CheckCarrier
  593.     FalseJump waitring
  594.  
  595.     ; Check if remote called at a bps rate other than we accept
  596.     ;Cmp $(baud) 2400
  597.     ;FalseJump unwelcome
  598.  
  599.     Set banner "\r\n\r\n\r\n  $(host.sitename) $(host.address) and $(WelMatName)<->$(WPLNAME)\r\n  running under $(ROOFNAME)\r\n  welcomes your $(lastResponse) at $<time> on $<date>\r\n"
  600.     SubJump dobanner
  601.  
  602.   mconnect:
  603.     Set session INBOUND
  604.     Set state "SESSION INBOUND unknown"
  605.     ; ALLOWFREQS is a ENV: variable that we can set via CRON events
  606.     CmpI ${ALLOWFREQS} TRUE
  607.     FalseJump do_menu
  608.         Set host.freq TRUE
  609.  
  610.  ; re-entry point for login commands which allow multiple selection at login
  611.  ; variable $(menu) toggles this feature
  612.   do_menu:
  613.     Clear namebuf event
  614.     Set banner "\n\r  Type 'info' for more information or enter command\r\n"
  615.     ; ACCESS is set FALSE by a cron event when we wish 
  616.     ; to disallow BBS spawning. Here we select a banner to display.
  617.     CmpI ${ACCESS} TRUE
  618.     TrueJump welcome
  619.         Set banner "\n\r  $(host.sitename) $(host.address)\r\n  Mailers only at this time\r\n  Type 'info' for more information\r\n"
  620.   welcome:
  621.     SubJump dobanner
  622.  
  623.     ; ========================= GETINBOUND ==============================
  624.     ; check for the inbound event (YooHoo,Login,FTS1,etc) (Russ set 60 seconds!)
  625.     GetInbound $(logindelay)
  626.     PutLog "$<time> InboundEvent:[$(event)] Wzcap:[$(host.wzcap)]:[$(remote.wzcap)] NameBuf:[$(namebuf)]"
  627.     ; check if remote dropped carrier early
  628.     CmpI $(event) CARRIER
  629.     TrueJump waitring
  630.     ; no event response before timeout
  631.     CmpI $(event) TIMEOUT
  632.     FalseJump mconnect1
  633.         Set banner "\n\rYou have exceeded $(logindelay) sec. input timeout, Bye\n\r"
  634.         SubJump dobanner
  635.         Jump waitring
  636.  
  637.   mconnect1:
  638.     CmpI $(event) LOGIN
  639.     TrueJump get_login
  640.  
  641.   mconnect2:
  642.     ; here we could also selectivly enable/disable file requests 
  643.     ; via a cron event. 
  644.     CmpI $(event) FTS1
  645.     FalseJump mconnect3
  646.         Set state "SESSION INBOUND FTS1"
  647.         ; hopefully filenotify will be able to set the remote address
  648.         ; IF the first file is a poll packet. At this point it is unknown.
  649.         Set remote.address 1:1/1.1
  650.         CmpI ${FTSFREQS} TRUE
  651.         TrueJump lotekin
  652.             Set host.freq FALSE
  653.             Jump lotekin
  654.  
  655.   mconnect3:
  656.    Set expect "GOTYOOHOO"
  657.    CmpI $(event) $(expect)
  658.    FalseJump mconnecterr        
  659.         SubJump wazoo
  660.         FalseJump wazooerr        
  661.             WazooRespond
  662.             Print "WazooRespond: $(event)\n"
  663.             Set expect 2U2
  664.             CmpI $(event) $(expect)
  665.             FalseJump mconnecterr 
  666.   mconnect3.0:       
  667.                 Set state "SESSION INBOUND $(remote.address)"
  668.                 Address "RoofLog" "LOGLINE $<time> WelMat: Inbound Session $(remote.address)"
  669.                 ; Send files destined to the site
  670.                 Connected $(remote.address)
  671.                 Cmp $(host.wzcap) 8
  672.                 TrueJump zedzapin
  673.                 Cmp $(host.wzcap) 4
  674.                 TrueJump zedzipin
  675.                 Cmp $(host.wzcap) 1
  676.                 FalseJump nodietin
  677.                     PutLog "$<time> DietIFNA fallback"
  678.                     Jump dietifnain
  679.  
  680.   nodietin:
  681.     ; must be lotek :)
  682.     PutLog "$<time> "FTS1 fallback"
  683.     Jump lotekin
  684.  
  685.   wazooerr:
  686.     PutLog "$<time> WaZoo failed"
  687.     Clear expect
  688.     ReportSesStat 111
  689.     Jump waitring
  690.    
  691.   mconnecterr:
  692.     PutLog "$<time> WaZoo failed:[$(event)] expected:[$(expect)]"
  693.     Clear expect
  694.     ReportSesStat 111
  695.     Jump waitring
  696.  
  697.  ; login procedures
  698.   get_login:   
  699.        ; check if login was invoked by line noise
  700.         CmpI $(namebuf) ""
  701.         TrueJump do_menu
  702.             Set state "SESSION LOGIN $(namebuf)"
  703.  
  704.             ; do your uucp stuff here :)
  705.  
  706.   ck_bbs:
  707.             ; check if 'BBS' was returned by user ESC-ESC sequence
  708.             CmpI $(namebuf) BBS
  709.             FalseJump ck_emp
  710.                 ; ACCESS is set FALSE by a cron event when we wish 
  711.                 ; to disallow BBS spawning during Universal Mail Hour
  712.                 CmpI ${ACCESS} TRUE
  713.                 FalseJump no_access
  714.     ; set wether we hangup or return to Login prompt
  715.     set menu FALSE
  716.     Set banner "\n\r  Please wait, BBS Loading time depends on system load\n\r"
  717.     SubJump dobanner
  718.   ;  Set systemcmd "run >NULL: Sound:sound Sound:fx/drip"
  719.   ;  SubJump dosys
  720.     Set systemcmd "Rx ${REXXDIR}/Launch_BBS $(Baud) $(line)"
  721.     SubJump dosys
  722.     PutLog "BBS RC:$(RC)"
  723.     Jump waitring
  724.  
  725.   ck_emp:
  726.             CmpI $(namebuf) EMP
  727.             FalseJump ck_rfx
  728.                 ; ACCESS is set FALSE by a cron event when we wish 
  729.                 ; to disallow Empire spawning during Universal Mail Hour
  730.                 ; we could use a separate variable for this
  731.                 CmpI ${ACCESS} TRUE
  732.                 FalseJump no_access
  733.     ; set wether we hangup or return to Login prompt
  734.     set menu TRUE
  735.     Set banner "\n\r  Please wait, EMPIRE Loading time depends on system load\n\r"
  736.     SubJump dobanner
  737.   ;  Set systemcmd "run >NULL: Sound:sound Sound:fx/drip"
  738.   ;  SubJump dosys
  739.     ; default extension for scripts accessing wpl commands is .welmat
  740.     ; Address allows us to call wpl functions from the script
  741.     Address "REXX" "MAIL:rexx/EMP $(baud) $(line)"
  742.     PutLog "EMP RC:$(RC)"
  743.     CMPI $(menu) TRUE
  744.     TrueJump do_menu
  745.        Jump waitring
  746.  
  747.   ck_rfx:
  748.             ; check for File Xfer request
  749.             CmpI $(namebuf) RFX
  750.             FalseJump do_login
  751.                 ; set wether we hangup or return to Login prompt
  752.                 set menu TRUE
  753.                 ; ACCESS is set FALSE by a cron event when we wish 
  754.                 ; to disallow RFX spawning during Universal Mail Hour
  755.                 ; we could use a separate variable for this
  756.                 CmpI ${ACCESS} TRUE
  757.                 FalseJump no_access
  758.  
  759.     ; set wether we hangup or return to Login prompt
  760.     set menu FALSE
  761.     PutLog "$<time> Roof File Server loading"
  762.     Set banner "Loading Roof File Xfer Server on Line $(line)\r\n"
  763.     SubJump dobanner
  764.     ; default extension for scripts accessing wpl commands is .welmat
  765.     Address "REXX" "MAIL:rexx/RFX $(line)"
  766.     CMPI $(menu) TRUE
  767.     TrueJump do_menu
  768.         Jump waitring
  769.  
  770.   no_access:
  771.     Set banner "\n\r  $(system) $(namebuf) not available during Universal Mail Hour\n\r"
  772.     SubJump dobanner
  773.     Jump do_menu
  774.  
  775.   do_login:
  776.     Set UserName $(namebuf)
  777.     PutLog "$<time> External Command for User:$(UserName)"
  778.     Set systemcmd "Login <NULL: >NULL: -lower -o${W_SLAVE_LOGFILE} -pCFG:Passwd -d$(device) -u$(unit) -b$(Baud) \"$(UserName)\""
  779.     SubJump dosys 
  780.     PutLog "Login RC:$(RC)"
  781.     Cmp $(RC) 1
  782.     TrueJump do_menu
  783.         ReportSesStat 666
  784.         Jump waitring
  785.  
  786.  
  787.  ;============================= XPR Interface ===============================
  788.  
  789.   ; Ascii send a text file and return to mconnect
  790.   ; This requires an as yet unavailable BATCH version of xprascii.library 
  791.   ;asciiout: 
  792.   ;  Set protocol ASCII
  793.   ;  Set tadr 0:0/0.0
  794.   ;  Set remote.address $(namebuf)#$(tadr)
  795.   ;  SetMailerFlags "DN,PN"
  796.   ;  Address "FLOWMGR" "FLOWADD $(tadr) $(textfile)"
  797.   ;  Set banner "Please wait...."
  798.   ;  SubJump dobanner
  799.   ;  System "Wait 3"
  800.   ;  Connected $(remote.address)
  801.   ;  SetMailerFlags "DN,PN"
  802.   ;  XprSetup xprascii.library "C5,L10"
  803.   ;  SubJump set_xprstatus 
  804.   ;  PutLog "$<time> $(protocol) setup:$(XprSetup) RC:$(RC)"
  805.   ;  XprSend ""
  806.   ;  PutLog "$<time> $(protocol):$(RC)"
  807.   ;  XprClose
  808.   ;  SetUpdate null
  809.   ;  Clear IsOutbound 
  810.   ;  Jump do_menu
  811.  
  812.   zedzipout:
  813.     ; Use dummy packet if no other files exist
  814.     SetMailerFlags "DE,PN"
  815.     XprSetup xprzedzap.library TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NN,M1024
  816.     SubJump set_xprstatus 
  817.     Jump xprout
  818.  
  819.   zedzapout:
  820.     ; turn off the generation of the dummy poll packet
  821.     SetMailerFlags "DN,PN"
  822.     XprSetup xprzedzap.library TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NY,M8192,C$(Baud)
  823.     SubJump set_xprstatus
  824.   zmodemout:
  825.     Jump xprout
  826.  
  827.   zedzipin:
  828.     ; Use dummy packet if no other files exist
  829.     SetMailerFlags "DE,PN"
  830.     XprSetup xprzedzap.library TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NN,M1024
  831.     SubJump set_xprstatus
  832.     Jump xprin
  833.  
  834.   zedzapin:
  835.     ; turn off the generation of the dummy poll packet
  836.     SetMailerFlags "DN,PN"
  837.     XprSetup xprzedzap.library TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NY,M8192,C$(Baud)
  838.     SubJump set_xprstatus
  839.   zmodemin:
  840.     Jump xprin
  841.  
  842.   lotekout:
  843.     FindFreq $(called)
  844.     SetMailerFlags "DY,PY"
  845.     Jump xmodemout
  846.  
  847.   dietifnaout:
  848.     SetMailerFlags "DY,PN"
  849.   xmodemout:
  850.     Putlog "$<time> $(protocol) ftsflags: ${ftsflags.$(remote.product)}"
  851.     XprSetup xprfts.library "${ftsflags.$(remote.product)}"
  852.     SubJump set_xprstatus
  853.     PutLog "$<time> $(protocol) Setup:$(XprSetup) RC:$(RC)"
  854.     Jump xpr_send
  855.  
  856.   lotekin:
  857.     SetMailerFlags "DY,PY"
  858.     XprSetup xprfts.library "7y,cy,ob,ib,sy,bn,an,ny,wy,fy"
  859.     Jump xmodemin
  860.  
  861.   dietifnain:
  862.     SetMailerFlags "DY,PN"
  863.     PutLog "$<time> $(protocol) ftsflags: ${ftsflags.$(remote.product)}"
  864.     XprSetup xprfts.library "${ftsflags.$(remote.product)}"
  865.   xmodemin:
  866.     SubJump set_xprstatus
  867.     PutLog "$<time> $(protocol) Setup:$(XprSetup) RC:$(RC)"
  868.     Jump xpr_recv
  869.  
  870.  ; common xpr procedures
  871.   xprout:
  872.     PutLog "$<time> $(protocol) Setup:$(XprSetup) RC:$(RC)"
  873.     XprSend ""
  874.     ; PutLog "$<time> $(protocol) Send:$(RC)"
  875.     FalseJump xprend
  876.   xpr_recv:  
  877.         XprReceive ""
  878.         ; PutLog "$<time> $(protocol) Receive:$(RC)"
  879.         Jump xprend
  880.  
  881.   xprin:
  882.     PutLog "$<time> $(protocol) Setup:$(XprSetup) RC:$(RC)"
  883.     XprReceive ""
  884.     ; PutLog "$<time> $(protocol) Receive:$(RC)"
  885.     FalseJump xprend
  886.   xpr_send:
  887.         XprSend ""
  888.         ; PutLog "$<time> $(protocol) Send:$(RC)"
  889.         Jump xprend
  890.  
  891.   xprend:
  892.     ; a common exit for all XPR's
  893.     XprClose
  894.     SetUpdate null
  895.     Print "$(protocol) session complete:$(RC)\n"
  896.     PutLog "$<time> $(remote.address) $(protocol) RC:$(RC)"
  897.     ; report the DIAL was a SUCCESS to rexx caller
  898.     ; Call.rexx is not interested in Xfer failures
  899.     ;  ReportSesStat $(RC)
  900.     ReportSesStat 0 
  901.     Jump waitring
  902.  
  903.  
  904.   ; ====================== PRE/POST FILE PROCESSING ========================
  905.   pro:
  906.     PutLog "$<time> Sending:$(localfile) [$(filesize)] as $(remfile) to $(remote.address)"
  907.   Return
  908.  
  909.   poo:
  910.     PutLog "$<time> $(filestatus): $(localfile)"
  911.     ; check to make sure the file was 'sent'
  912.     FalseJump xfererr
  913.         PutLog "$<time> CPS:$(CPS) ($(CPSP)%) FileSize:$(filesize) bytes"
  914.         Set systemcmd "run >NIL: Rx \"Address 'RoofCMD' SHOWSENT $(remfile) '$(remote.address)' $(filesize)\""
  915.         SubJump dosys
  916.   Return
  917.  
  918.   xfererr:
  919.     PutLog "$<time> $(protocol) xfer failed:$(remfile) RC:$(RC)"
  920.   ;  Set systemcmd "Rx \"Address 'RoofLog' LOGLINE \"$<time> WelMat: Failed:$(state) $(protocol) $(remote.address) $(remfile) [$(localfile)]\"\""
  921.     Set systemcmd "Run >NIL: Rx \"Address 'RoofLog' LOGLINE \"$<time> WelMat: Failed:$(state) $(protocol) $(remote.address) $(remfile) [$(localfile)]\"\""
  922.     SubJump dosys
  923.   Return
  924.  
  925.   pri:
  926.     PutLog "$<time> Receiving:$(remfile) as $(tempfile) from $(remote.address)"
  927.   Return
  928.  
  929.  ; =========================== INBOUND NOTIFICATION ========================
  930.   ; this subroutine is called when a file is received.
  931.   poi:
  932.     PutLog "$<time> $(filestatus): $(infile) ($(remfile))"
  933.     ; check to make sure the file was 'received'.
  934.     FalseJump xfererr
  935.         PutLog "$<time> CPS:$(CPS) ($(CPSP)%) FileSize:$(filesize) bytes"
  936.  
  937.     ; do inbound notification
  938.     ; if an INBOUND FTS1 session, we try to get the address from the packet
  939.     Set RC $(FTS1)
  940.     FalseJump filenotify1
  941.         PutLog "$<time> FTS1 Receive $(remfile)"
  942.         ; if we are dialing , we KNOW the address
  943.         Pattern $(state) #?OUTBOUND#?
  944.         TrueJump filenotify1
  945.             Cmp $(recfile) 1
  946.             TrueJump filenotify1
  947.                 Pattern $(remfile) #?.PKT
  948.                 FalseJump filenotify1.1
  949.                     PutLog "$<time> FirstFile?"
  950.                     Set recfile 1
  951.                     ; sets remote.address wpl variable to the address 
  952.                     ; found in firstfile if it's a Type 2 packet
  953.                     ; we assume domain is FIDONET
  954.                     Address "FLOWMGR" "READPKT $(remfile)"
  955.                     ; seems slave does not process message from 
  956.                     ; FlowHost fast enough, so we add a wait
  957.     System "Wait 1"
  958.                     Set systemcmd "$(lookup) FidoNet#$(remote.address) nodelist: $(line)"
  959.                     SubJump dosys
  960.                     PutLog "Found FTS1 ${$(line).address}"
  961.                     Cmp ${$(line).address} ":/."
  962.                     TrueJump filenotify0
  963.                         SubJump setnode
  964.                         SetMailerFlags "DY,PY"
  965.                         ; Queue files destined to this site
  966.                         ; we can get the address, but cannot get queue once xfers have begun!
  967.                         ; Connected $(remote.address)
  968.                         Jump filenotify1.1
  969.                 filenotify0:
  970.                     Set $(remote.address) fidonet#1:1/1.2
  971.   Return
  972.  
  973.   filenotify1:
  974.     PutLog "$<time> $(protocol) Receive $(remfile)"
  975.  
  976.   filenotify1.1:
  977.     Set systemcmd "run Ram:Wnotify >LOG:Freq.log CFG:Wnotify.cfg $(remfile) $(infile) \"$(remote.address)\" $(line)"
  978.     ; flag for wnotify log copy to roof logfile
  979.     Pattern $(remfile) #?.REQ
  980.     FalseJump filenotify1.2
  981.         Set req TRUE
  982.         Set RC $(host.freq)
  983.         TrueJump dosys
  984.             PutLog "$(remote.address) ignored WaZoo No-FREQS"
  985.             ; We might just want to hang up on this guy :)
  986.             ; or send him a nasty message
  987.             ; Jump filenotify1.2
  988.  
  989.   filenotify1.2:
  990.     Set systemcmd "Run >NIL: Rx \"Address 'RoofCMD' SHOWRECD $(remfile) '$(remote.address)' $(filesize)\""
  991.     SubJump dosys
  992.     
  993.   ; we disable processing mail or tic if address is not known to us
  994.     CmpI $(issecure) TRUE
  995.     TrueJump iswierd
  996.         PutLog "$<time> $(remfile) from $(remote.address) is non-secure"
  997.         Jump logfiles
  998.  
  999.   iswierd:
  1000.     CmpI $(multihub) FALSE
  1001.     TrueJump known
  1002.         PutLog "$<time> Sorting $(remfile) from $(remote.address)" 
  1003.         Set systemcmd "Run >NIL: Rx ${REXXDIR}/FTNsort $(remfile)"
  1004.         Jump isnot
  1005.  known:      
  1006.     Set systemcmd "Run >NIL: Rx \"Address 'RoofCMD' IMPORT TOSSARC $(host.domain)\"" 
  1007.  isnot:
  1008.     Pattern $(remfile) ????????.(MO|TU|WE|TH|FR|SA|SU)[0-9] 
  1009.     TrueJump dosys
  1010.  
  1011.     Set systemcmd "Run >NIL: Rx \"if word(statef('$(infile)'),2) ~= '60' then address 'RoofCMD' IMPORT TOSSPKT $(host.domain) $(remfile)\""
  1012.     Pattern $(remfile) ????????.PKT 
  1013.     TrueJump dosys
  1014.  
  1015.     Set systemcmd "Run >NIL: Ftick CFG:Ftick.cfg.$(host.domain)"
  1016.     Pattern $(remfile) #?.TIC 
  1017.     FalseJump logfiles
  1018.         Set tic TRUE
  1019.         Jump dosys
  1020.  
  1021.   ; since it's not ARCmail, PKT or TIC, let's show it in Roof's log
  1022.   logfiles:
  1023.     Address "RoofLog" "LOGLINE $<time> WelMat: Received $(remfile) from $(remote.address)"
  1024.   Return
  1025.  
  1026.  ; =============================== Host Address Setup ==========================
  1027.   fidohost:
  1028.     Set host.domain     "fidonet"
  1029.     Set host.zone  1
  1030.     Set host.net   167
  1031.     Set host.node  104
  1032.     Set host.point 0
  1033.     Set host.wzdomain   "fidonet.org"
  1034.     Set host.address $(host.domain)#$(host.zone):$(host.net)/$(host.node).$(host.point)
  1035.     Set inbound ${INDIR}/FIDONET/
  1036.   Return
  1037.  
  1038.   mtlhost:
  1039.     Set host.domain     "mtlnet"
  1040.     Set host.zone  17
  1041.     Set host.net   514
  1042.     Set host.node  300
  1043.     Set host.point 0
  1044.     Set host.wzdomain   "mtlnet.ftn"
  1045.     Set host.address $(host.domain)#$(host.zone):$(host.net)/$(host.node).$(host.point)
  1046.     Set inbound ${INDIR}/MTLNET/
  1047.   Return
  1048.  
  1049.   anethost:
  1050.     Set host.domain     "amiganet"
  1051.     Set host.zone  40
  1052.     Set host.net   600
  1053.     Set host.node  104
  1054.     Set host.point 0
  1055.     Set host.wzdomain   "amiganet.ftn"
  1056.     Set host.address $(host.domain)#$(host.zone):$(host.net)/$(host.node).$(host.point)
  1057.     Set inbound ${INDIR}/AMIGANET/
  1058.   Return
  1059.  
  1060.  ; ============================ SET GLOBALS ===============================
  1061.   setglobals:
  1062.  ; Clear temporary variables - As well as for documentation purposes, it will
  1063.  ; free up some memory for ya ;-)
  1064.     Clear req protocol systemcmd 
  1065.     Clear event fts1 infile isoutbound
  1066.     Clear remfile localfile filesize called
  1067.     Clear NameBuf OwnDevUnit UserName
  1068.     Clear lastresponse resp ENTRY
  1069.     Clear recfile
  1070.  
  1071.     Clear remote.address remote.cost remote.domain remote.flags 
  1072.     Clear remote.maxBaud remote.net remote.node remote.point remote.zone
  1073.     Clear remote.number remote.product remote.product_maj remote.product_min remote.freq
  1074.     Clear remote.sitename remote.sysop remote.wzcap remote.wzdomain remote.password
  1075.  
  1076.  ; System set up variables cleared.
  1077.     Clear process RC Result2 
  1078.  
  1079.  ; Reset constants 
  1080.  ; These ENV vars ${} from Roof.CFG
  1081.     ; Inbound directory used to place inbound files - '/' required.
  1082.     ; default inbound for known nodes
  1083.     Set secure ${INDIR}/FIDONET/
  1084.     ; unknown nodes and user uploads
  1085.     Set nonsecure ${INDIR}/NONSECURE/
  1086.     ; current
  1087.     Set inbound $(secure)
  1088.  
  1089.     ; directory to look for 'special' files such as 2-d and 4-d .REQ files.
  1090.     Set outbound ${OUTDIR}/
  1091.  
  1092.     ; used by PutLog and FlushLog
  1093.     Set currentlog all
  1094.  
  1095.     Set MaxSendPri 127 MinSendPri -127 BufferSize 1024
  1096.     Set stack 50000 priority 0
  1097.  
  1098.  ; Variables used by ModemInit
  1099.     Set InitLoop          5
  1100.     Set InitWait          1
  1101.     Set Prompt            OK
  1102.  ;    Set Atten        $(atten)
  1103.  ;   Set HangupString $(hangupstring)
  1104.  ;   Set InitString   $(initstring)
  1105.    
  1106.     ; These ENV vars ${} from Roof.CFG
  1107.     Set host.sysop      ${SYSOP}
  1108.     Set host.Sitename   ${SYSTEM}
  1109.     SubJump fidohost
  1110.  
  1111.     Set pickup "TRUE" trywazoo "TRUE" tryfts1 "TRUE" 
  1112.  
  1113.  ; Wazoo capability bits are 'added' together - 'GetOutbound' and 'GetInbound'
  1114.  ; reset $(host.wzcap) to a single protocol value after a YooHoo negotiation.
  1115.  ;
  1116.  ; 1  - Can do fast "FTS-0001" (DietIFNA)
  1117.  ; 2  - Reserved by Opus-CBCS (FTB_user)
  1118.  ; 4  - Does ZModem, 1K blocks (ZedZip)
  1119.  ; 8  - Can do ZModem variant (ZedZap)
  1120.  ; 16 - Can do Janus
  1121.  ; 32 - reserved by FTSC
  1122.  
  1123.     ; DietIFNA, ZedZip, ZedZap
  1124.     Set host.wzcap 13
  1125.  
  1126.    ; Set the label that Welmat will go to when it start and ends 
  1127.    ; a send or receive of a file in the XPR interface.
  1128.    ; (Set the value equal to the name of the variable itself to make life simple)
  1129.     Set postinbound postinbound postoutbound postoutbound
  1130.     Set preinbound preinbound preoutbound preoutbound
  1131.  
  1132.     ; the program used to Lookup Nodelist Info is defined 
  1133.     ; as an ENV: variable in ROOF.CFG. Output is redirected.
  1134.     Set lookup "${LOOKUP} >NIL:"
  1135.  
  1136.     ; time to wait of an event on answering
  1137.     Set logindelay 60
  1138.  
  1139.     Set multihub FALSE issecure TRUE
  1140.  
  1141.   ; debug - display system command in status window
  1142.     Set ShowSystem TRUE
  1143.   Return
  1144.  
  1145.  ; ============================== SLAVE STARTUP =============================
  1146.  startup-1:
  1147.     Set WelMatName ${WelmatName}
  1148.     Set WPLNAME "${W_LNG} v49.62" 
  1149.     Set ROOFNAME "${ROOFNAME} v${RVER}.${RTAB}<->CFG v.${RCFGVER}"
  1150.  
  1151.     Set sl 70 speech  "Compiling $(WPLNAME)"
  1152.     SubJump sayit
  1153.     
  1154.     Set line 1
  1155.     PutLog "$<time> Launching Slave:$(line)"
  1156.  
  1157.  ;  Device and Unit and serial flags for the serial port.
  1158.  ;  Serial flags are added together to get value desired.
  1159.  ;              1     Parity on
  1160.  ;              2     Parity Odd
  1161.  ;              4     7-Wire Modem (RTS/CTS)
  1162.  ;             16     Rad Boogie 
  1163.  ;             32     Shared Mode
  1164.  ;            128     Disable Xon/Xoff handshaking
  1165.  ; 
  1166.     Set device "serial.device" unit 0 serflags 160
  1167.  ;
  1168.  ; NOTE:  One should always disable Xon/Xoff and use Shared mode with BBS's
  1169.  ; and Login.
  1170.  ;  Also, never set the two bits not mentioned above!
  1171.  ;
  1172.  
  1173.     Set BaudLocked 2400 Baud 2400
  1174.  ; Sets $(Baud) and $(Baudlocked) and will set device 
  1175.  ; Baud rate if device is open
  1176.     SetBaud 2400
  1177.  
  1178.  ; DTR control:
  1179.  ;              0       No support for DTR
  1180.  ;              1       Internal port 'twiddling the bits' 
  1181.  ;                      - *ONLY USE THIS ON INTERNAL!!!*
  1182.  ;              2       SET_CTRL_LINES method 
  1183.  ;                      (ASDG DSB, PDIO, CMI Multiport, CSA Magnum)
  1184.  ;  Will be expanded to include any new methods (IE CBM??) that come out.
  1185.  ;
  1186.    Set DTR_Control       1
  1187.  
  1188.  ; Size of the serial input buffer in Kilobytes
  1189.    Set SerBuf 8
  1190.   
  1191.  ; Set up the response strings for GetResponse - These are 'line specific'.
  1192.  ; The first parameter is the 'event'.  If it is a number, or if it is 'find',
  1193.  ; then it is a special event called 'CONNECT' where the Baud rate is set to
  1194.  ; the number, or figured out from the %d value in 'find'.
  1195.  ;
  1196.  ;              EVENT  Modem Response
  1197.     AddResponse busy    "BUSY"
  1198.     AddResponse busy    "NO CARRIER"
  1199.     AddResponse busy    "NO ANSWER"
  1200.     AddResponse busy    "NOANSWER"
  1201.     AddResponse line    "VOICE"
  1202.     AddResponse line    "CONNECT|"
  1203.     AddResponse find    "CONNECT %d"
  1204.     AddResponse find    "CONNECT %d/ARQ"
  1205.     AddResponse find    "CONNECT %d/Rel"
  1206.     AddResponse ring    "RING"
  1207.   ; this is answer during dial :)
  1208.     AddResponse ring    "NO DIAL TONE"
  1209.  
  1210.     Set Locked          FALSE
  1211.     Set SlowModem       FALSE
  1212.     Set Atten           |~AT|
  1213.     Set HangupString    v~~^~~ATH0|~AT|
  1214.     Set InitString      ~ATX4V1M1E1S10=30S0=0S7=45S9=6&I0&K1&M4|
  1215.     ;Set DialString     ~AT&K0&M0DT
  1216.     ;Set MNPAnswerString   AT&K1&M4A|
  1217.     ;Set NOMNPAnswerString   AT&K0&M0A|
  1218.     SetMailerFlags "DY,PY"
  1219.     SubJump setglobals
  1220.  
  1221.     Set sl 70 speech  "I am $(host.sitename) at $(host.address)" 
  1222.     SubJump sayit
  1223.  
  1224.     ; Debugging - output variables to this file
  1225.     ;SetStatus "LOG:slave.out"
  1226.     ;Print "\n\nWPL vars after slave init\n\n"
  1227.     ;-ListVars
  1228.  
  1229.  ; Set offset for this slave's Xpr status window
  1230.     Set $(line).w_offset 130
  1231.  
  1232.  ; Sets up the status window. The window title defined in Roof.cfg 
  1233.  ; contains $(line) var which is filled by the slave
  1234.  ; These ENV vars ${} from Roof.CFG
  1235.     Set pscreen ${ROOFSCREEN}
  1236.     SetStatus "${W_SLAVE_STATUS}$(pscreen)
  1237.     PutLog "$<time> $(WPLNAME)"
  1238.  
  1239.     Address "RoofLog" "LOGLINE $<time> WelMat: Slave $(line) launched"
  1240.     Jump slaveloop 
  1241.  
  1242.  ; ============================ WelMat Startup ==============================
  1243.  ;  The main function called by Welmat in the MCP is 'startup' - This should
  1244.  ; always be included, and is the first label called!
  1245.  ; It is included at the end of the config for efficiency reasons (IT's only
  1246.  ; called 'once'
  1247.   startup:
  1248.     Address "RoofLog" "LOGLINE $<time> WelMat: Compiling"
  1249.     Set line 1
  1250.     Set currentlog all
  1251.     SubJump setglobals
  1252.     Launch 1 SLAVE1 startup-1
  1253.  
  1254.     ; Some systems may need a Wait here, so that the 
  1255.     ; 'slaves' var is properly set
  1256.  
  1257.     PutLog "$<time> $<date> ${WelmatName}/KS:${Kickstart}"
  1258.     PutLog "$<time> SuperSlave Exiting..."
  1259.    
  1260.     Set sl 70 speech "SLAVE $(line) started"
  1261.     SubJump sayit
  1262.  
  1263.     ; Debugging - output variables to this file
  1264.     ;SetStatus "LOG:welmat.out"
  1265.     ;-ListConfig
  1266.     ;Print "\n\n\nWPL vars at startup\n\n"
  1267.     ;-ListVars
  1268.     Set RC 0
  1269.   Return
  1270.  
  1271.   ;========================== Security Checks =============================
  1272.  
  1273.  ; ck_secure could be script that checks the packet address, packet password, 
  1274.  ; ARCfile name.etc.
  1275.  ; The example script is minimal and should NOT be used unmodified
  1276.  ; ck_secure:
  1277.     ; address "REXX" "Mail:REXX/IsSecure $(remfile) $(host.net) $(host.node) $(remote.net) $(remote.node)"
  1278.     ; TrueJump dosys
  1279.         ; We move file to our NONSECURE directory, 
  1280.     ;   Set systemcmd "Rename >nil: $(infile) $(nonsecure)$(remfile)
  1281.     ;   Jump dosys
  1282.  
  1283.